import linear_algebra as la

if __name__ == "__main__":
    m1 = la.Matrix([[1, 2], [3, 4]])
    print(m1)
    print("m1.shape={}".format(m1.shape()))
    print("m1.size={}".format(m1.size()))
    print("len(m1)={}".format(len(m1)))
    print("m1[0, 0]={}".format(m1[0, 0]))
    print("m1 0 row vector = {}".format(m1.row_vector(0)))

    m2 = la.Matrix([[5, 6], [7, 8]])
    print("m1 + m2 ={}".format(m1 + m2))
    print("m1 - m2 ={}".format(m1 - m2))
    print("m1 * 2 ={}".format(m1 * 2))
    print("2 * m1 ={}".format(2 * m1))
    print("-m1={}".format(-m1))
    print("zero_2_3:{}".format(la.Matrix.zero(2, 3)))

    print("m1 * m2 ={}".format(m1.dot(m2)))

    v1 = la.Vector([1, 2])
    m3 = la.Matrix([[2, 0], [0, 2]])
    print("m3 * v1 = {}".format(m3.dot(v1)))

    m4 = la.Matrix([[-1, 0], [0, 1]])
    print("m4 * v1 = {}".format(m4.dot(v1)))

    print("m1 T is {}".format(m1.T()))
    
